package com.wzy.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfig  implements WebMvcConfigurer {


    //不需要为每一个访问thymeleaf模板页面单独开发一个controller请求了
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        //viewController 请求路径    viewName: 跳转视图
        registry.addViewController("/").setViewName("redirect:/login");
        registry.addViewController("login").setViewName("login");
        registry.addViewController("register").setViewName("regist");
        registry.addViewController("addYjs").setViewName("addYjs");
        registry.addViewController("addKt").setViewName("addKt");
        registry.addViewController("mainView").setViewName("mainView");
        registry.addViewController("userLogin").setViewName("userLogin");
        registry.addViewController("managerView").setViewName("managerView");
        registry.addViewController("userView").setViewName("userView");
    }
}
